Learn Order Fulfilment Workflow, System APIs & Security

Understand the order processing workflow, API, and security of the system.

Order fulfilment workflow#

Let’s first define some acronyms which we will be using later on:

  • Ordering Service: OS
  • Order Fulfilment Service: OFS
  • Notification Service: NS
  • DoorDasher Dispatch Service: DDS
  • Message: MSG

Order workflow explained#

Once the customer places an order using the mobile/web client using the OS, the order processing workflow could be as follows:

  1. OS publishes a MSG(#1) to the queue about the order so that the downstream services can start processing.
  2. NS reads MSG(#1) and notifies the corresponding restaurant and the customer that an order is placed and pending their acceptance.
  3. Once the order is accepted by the restaurant, using the OFS, the OFS will publish a MSG(#2) to the queue regarding the acceptance of the order.
  4. DDS will read the MSG(#2) and post an area-specific MSG(#3) to the queue. DDS could also auto-assign an order to an available DoorDasher, and in which case, it will post a related MSG.
  5. NS will read MSG(#2) and notify the customer that the restaurant accepted the order.
  6. NS will read MSG(#3) and notify the DoorDashers in the area about the availability of the order to process their acceptance.
  7. The DoorDasher will accept the order using DDS. DDS will then post a MSG(#4) to the queue about DoorDasher assignment/acceptance.
  8. NS will read MSG(#4) and notify the customer and the restaurant about the DoorDasher assignment.
  9. Once the food is ready to be picked up, the restaurant will update the status of the order using OFS. OFS will post a MSG(#5) to the queue that the food is ready to be picked up.
  10. NS will read MSG(#5) and notify the assigned DoorDasher as well as the customer that the food is ready to be picked up.
  11. After the DoorDasher picks up the food, the restaurant staff will update the status of the order using OFS. OFS will then post a MSG(#6) to the queue that the order has been picked up.
  12. NS reads MSG(#6) and notifies the customer that the order is picked up.
  13. DoorDasher reaches the customer, delivers the food, and marks the order as complete! The food is here!! DDS posts a MSG(#7) to the queue about delivery completion.
  14. OFS reads MSG(#7) and updates the status of the order to be completed.
  15. NS reads MSG(#7) and notifies the restaurant and the customer about the delivery of food.
Created with Fabric.js 3.6.3
Order workflow

1 of 14

Created with Fabric.js 3.6.3
Order workflow

2 of 14

Created with Fabric.js 3.6.3
Order workflow

3 of 14

Created with Fabric.js 3.6.3
Order workflow

4 of 14

Created with Fabric.js 3.6.3
Order workflow

5 of 14

Created with Fabric.js 3.6.3
Order workflow

6 of 14

Created with Fabric.js 3.6.3
Order workflow

7 of 14

Created with Fabric.js 3.6.3
Order workflow

8 of 14

Created with Fabric.js 3.6.3
Order workflow

9 of 14

Created with Fabric.js 3.6.3
Order workflow

10 of 14

Created with Fabric.js 3.6.3
Order workflow

11 of 14

Created with Fabric.js 3.6.3
Order workflow

12 of 14

Created with Fabric.js 3.6.3
Order workflow

13 of 14

Created with Fabric.js 3.6.3
Order workflow

14 of 14

System APIs#

Here are some of the customer-facing APIs exposed by the various services:

Ordering food:#

  • search (array of search terms)
  • addToCart(menu-item)
  • order(cart)
  • status(orderId)
  • retrieveOrder(orderId)
  • cancelOrder(orderId)

Profile management:#

  • createProfile
  • updateProfile
  • updateAddress
  • updatePaymentMethod

Sometimes the technical discussion could veer towards defining Rest APIs, URIs, identifying HTTP methods, sample entities, sample payloads, request-response, etc.

Let’s discuss what could be done to make the system secure.

Security

  • HTTPS/SSL -TLS for securing the wire. All communications between the web or mobile clients need to be on TLS.
  • OAuth 2.0 for token authorisation/refresh/generation.
  • In case the queuing system is Kafka, SASL per topic/SSL will be used.

Test your knowledge of what you have learnt in this lesson.

1

Notifications need to be delivered to which of the following actor(s)?

A)

DoorDasher

B)

Restaurant

C)

Customer

D)

Both B & C

Question 1 of 20 attempted
Creating the Component Design & Architecture of the System
Explore How to Handle Failure Points, Load Balancing, & Caching
Mark as Completed